<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "billing");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style >
	#outStockInfoCopy{display:none}
	.thumbnail{margin: 0px}
	#logo{margin: 0px;padding: 0px;}
	#pic{padding: 0px;height:60px;width:60px;}
	td input{margin-top:-1px;margin-bottom:-1px;height:21px; width:98%;border:none;color:red}
	#area{
		height:362px;
		width:1180px;
		overflow-y:auto; 
		overflow-x:hidden; 
	}
	
	body{
		font-size:9px ;
		font-family:黑体,微软雅黑;
	}
	.table{
		border:black 1px solid !important;
	}
	.table tr th{
		border:black 1px solid !important;
		text-align: center;
		padding:0px 2px !important;
	}
	.table tr td{	
		border:black 1px solid !important;
		padding:0px 2px !important;
		text-align: center;
	}
</style>
<script type="text/javascript">
 	function paceDoneCallback(){
		window.print(); 
		top.$("#modal_print_form").modal("hide");
	}  
</script>
<div id="printContent" >
	<c:set var="nullAll"  value="0"/>
	<c:set var="realPriceAll"  value="0"/>
	<c:set var="sequence"  value="0"/>
	<c:forEach var="outStockShow" items="${billing.outStock.outStockShows}">
		<c:forEach var="outStockCollocation" items="${outStockShow.outStockCollocations}" >
			<c:if test="${(sequence)%10==0&&sequence!=0}">
				<div style="page-break-after:always"></div>
			</c:if>
			<c:if test="${sequence==0}">
				<div class="text-center"><h3>${shop.shopName}销售单</h3></div>
				<table style="width:100%" border="0">
				    <tr>
				   	  <td >客户</td>
				   	  <td>${billing.customer.customerName}</td>
				      <td >开单日期</td>
				      <td><fmt:formatDate value="${billing.createDate}" type="date" dateStyle="default" pattern="yyyy-MM-dd"/></td>
				      <td >订单号</td>
				      <td >${billing.billingNo}</td>
				    </tr>
				    <tr>
				   	  <td >收货地址</td>
				      <td>${billing.address}</td>
					  <td >联系电话</td>	 
				   	  <td >${billing.customer.customerTel}</td> 
				   	  <td >欠款</td>	 
				      <td>${billing.unpaidAmount}</td>
				    </tr>	
				    <tr>
				   	  
				   	  
				    </tr>   	    
				</table>
			</c:if>
			<table class="table ">
				<c:if test="${(sequence)%10==0||sequence==0}">
					<tr>
						<th style="width:50px">序号</th>
			           	<th style="width:100px">条形码</th>
			           	<th style="width:250px">商品名称</th>
			           	<th style="width:50px">规格1</th>
			           	<th style="width:50px">规格2</th>
			           	<th style="width:50px">单位</th>
			           	<th style="width:50px">数量</th>
			           	<th style="width:50px">单价</th>
			           	<th>小计</th>
					</tr>
				</c:if>
				<c:set var="nullAll"  value="${nullAll +outStockCollocation.collocationNum}"/>
				<c:set var="realPriceAll"  value="${realPriceAll +outStockCollocation.realPrice*outStockCollocation.collocationNum}"/>
				<tr id="outStockCollocation_${sequence}">
					<td style="width:50px">${sequence +1}</td>				
		           	<td style="width:100px">${outStockShow.cargo.shapeCode}</td>
		           	<td style="width:250px">${outStockShow.cargo.cargoName}</td>
		           	<td style="width:50px">${outStockCollocation.collocation.propertyNameOne}</td>
		           	<td style="width:50px">${outStockCollocation.collocation.propertyNameTwo}</td>
					<td style="width:50px">${outStockShow.cargo.unit}</td>
					<td style="width:50px">${outStockCollocation.collocationNum}</td>
					<td style="width:50px">${outStockCollocation.realPrice}</td>
					<td>${outStockCollocation.realPrice*outStockCollocation.collocationNum}</td>
				</tr>
				<c:set var="sequence"  value="${sequence +1}"/>
				<c:if test="${sequence==count}">
					<tr>
						<td colspan="2">合计:</td>
						<td colspan="4">${tfn:toChinaMoney(realPriceAll)}</td>
						<th >${nullAll}</th>
			           	<th ></th>
			           	<th >${realPriceAll}</th>
					</tr>
					<tr border="0">
						<td>备注:</td>
			           	<th style="text-align: left;" colspan="8">${printDescribe.comment}</th>
					</tr>
					</c:if>
					</table>
					<c:if test="${sequence==count}">
					<table style="width:100%;margin-top:10px;" border="0">
					<tr>
						<td>工行:</td>
			           	<th style="text-align: left;" colspan="8">${printDescribe.work}</th>
					</tr>
					<tr>
						<td>地址:</td>
			           	<th style="text-align: left;" colspan="8">${printDescribe.address}</th>
					</tr>
					<tr>
						<td>网址:</td>
			           	<th style="text-align: left;" colspan="8">${printDescribe.myUrl}</th>
					</tr>
					</table>
				</c:if>
		</c:forEach>
	</c:forEach>
</div>

<script type="text/javascript">

</script>
<%request.setAttribute("noScripts","formpickers.location;"); %>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formvalidations.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/notifications.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/ui/moment.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>